import request from "@/utils/request";
import { CommentPublishParams, SecondCommentPublishParams } from "./type";

export const publishComment = (params: CommentPublishParams) => {
    return request.post(`/community/article/comment/publish`, params);
}

export const deleteComment = (commentId: string) => {
    return request.delete(`/community/article/comment/delete`, {
        params: {
            commentId
        }
    });
}

export const publishSecondComment = (params: SecondCommentPublishParams) => {
    return request.post(`/community/article/comment/publish/second`, params);
}

export const deleteSecondComment = (commentId: string) => {
    return request.delete(`/community/article/comment/delete/second`, {
        params: {
            commentId
        }
    });
}

export const likeComment = (commentId: string) => {
    return request.post(`/community/comment/like/publish`, null, {
        params: {
            commentId
        }
    });
}

export const cancelLikeComment = (commentId: string) => {
    return request.post(`/community/comment/like/cancel`, null, {
        params: {
            commentId
        }
    });
}
